<template>
  <div
    v-if="
      props.voteInfo.appBizVoteSetting.voteType === 'decision' ||
      props.voteInfo.appBizVoteSetting.votePattern === 'bycheck'
    "
    class="vote_check_box"
  >
    <!-- 选择投票 -->
    <p
      v-if="props.voteInfo.appBizVoteSetting.voteType === 'normal'"
      class="f12"
    >
      已选 {{ store.checkList.length }}
      {{ props.voteInfo.appBizVoteLayout.favourButtonUnit }}
      <template v-if="props.checkGroup?.minVote"
        >， 最少 <span class="blue">{{ props.checkGroup?.minVote || "" }}</span
        >{{ props.voteInfo.appBizVoteLayout.favourButtonUnit }}
      </template>
      <template v-if="props.checkGroup?.maxVote"
        >， 最多 <span class="blue">{{ props.checkGroup?.maxVote || "" }}</span>
        {{ props.voteInfo.appBizVoteLayout.favourButtonUnit }}
      </template>
    </p>
    <van-button
      :class="
        props.voteInfo.appBizVoteSetting.voteType === 'normal' ? 'w15' : 'flex1'
      "
      type="primary"
      @click="() => emit('handleSubmit')"
      >投票
    </van-button>
  </div>
</template>
<script setup>
import { store } from "./store.js";

const props = defineProps(["voteInfo", "checkGroup"]);
const emit = defineEmits(["handleSubmit"]);
</script>
<style scoped>
.vote_check_box {
  padding: 0.8rem 1.5rem;
  box-shadow: 0 0 0.4rem var(--van-gray-3);
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
</style>